#include "serial_C++.hpp"

Receive_Data_C receive_data_c;
void callback(const std::vector<uint8_t>& data)
{
    receive_data_c.data_arrange(reinterpret_cast<const char*>(data.data()));
    receive_data_c.my_print();
    receive_data_c.Data_Storage();
}
int main()
{
    SerialProtocolHandler SerialHandler("/dev/serial0",115200,8,1,'N',callback);
    SerialHandler.start_cv();
    // while(1)
    // {
    //     std::this_thread::sleep_for(std::chrono::milliseconds(1000));
    // }
    //pause();
    std::this_thread::sleep_for(std::chrono::milliseconds(10000));
    SerialHandler.stop();
    //std::cout << "end" << std::endl;
    return 0;
}